package cn.ggcms.cms.dao.impl;

import java.util.List;

import cn.ggcms.cms.dao.UserTypeDao;
import cn.ggcms.cms.utils.SimpleDao;
import cn.ggcms.cms.vo.UserType;

public class UserTypeImpl extends SimpleDao<UserType> implements UserTypeDao {

	public int doAddUserType(UserType type) {
		int id=0;
		try {
			id = super.save(type);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return id;
	}

	public boolean doDeleteUserType(int id) {
		boolean flag = false;
		try {
			super.delete(UserType.class, id);
			flag = true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return flag;
	}

	public boolean doUpdateUserType(UserType type) {
		boolean flag = false;
		try {
			super.update(type);
			flag = true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return flag;
	}

	public List<UserType> findUserTypeAll() {
		return super.find(UserType.class);
	}

	public UserType findUserTypeById(int id) {
		return super.get(UserType.class, id);
	}

}
